<script lang="ts" setup>
import { h, reactive } from 'vue'
const formList = reactive<FormList>([
  {
    label: '对象作为value',
    prop: 'select5',
    type: 'select',
    valueKey: 'value',
    value: { label: '选项4', value: 4 },
    data: [
      {
        label: '选项1',
        value: 1,
        default: c => h('div', { style: { color: 'red' } }, c.label)
      },
      { label: '选项2', value: 2 },
      { label: '选项3', value: 3 },
      { label: '选项4', value: 4 }
    ],
    rule: [{ required: true, trigger: 'blur' }]
  }
])
const submitForm = (formData: any) => {
  console.log(formData)
}
</script>
<template>
  <XyAddForm isCard :formList="formList" @submit-form="submitForm" />
</template>
